package com.kingre.et.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 常模表
 * 
 * @author Jingui.Yu
 * 
 */
@Entity
@Table(name = "t_model")
public class Model extends BaseObject implements Serializable {
    private static final long serialVersionUID = 4488575646233277712L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    // 性别：10=男；20=女
    private Integer sex;
    // 年级：1=毕业班；0=非毕业班
    private Integer grade;
    // 学位:{10=高职;20=本科;30=研究生}
    private Integer degree;
    // 1=自信心;2=责任心;3=团队合作;4=适应能力;5=创新能力;6=专业技能;7=实践经验;8=自我定位;9=求职方法;10=总分
    private Integer vd;
    private Integer rawValue;
    // T分
    private Float tValue;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getGrade() {
        return grade;
    }

    public void setGrade(Integer grade) {
        this.grade = grade;
    }

    public Integer getDegree() {
        return degree;
    }

    public void setDegree(Integer degree) {
        this.degree = degree;
    }

    public Integer getVd() {
        return vd;
    }

    public void setVd(Integer vd) {
        this.vd = vd;
    }

    public Integer getRawValue() {
        return rawValue;
    }

    public void setRawValue(Integer rawValue) {
        this.rawValue = rawValue;
    }

    public Float getTValue() {
        return tValue;
    }

    public void setTValue(Float value) {
        tValue = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Model)) {
            return false;
        }
        final Model model = (Model) o;
        return this.hashCode() == model.hashCode();
    }

    @Override
    public int hashCode() {
        int result;
        result = (id != null ? id.hashCode() : 0);
        result = 29 * result + (sex != null ? sex.hashCode() : 0);
        result = 29 * result + (grade != null ? grade.hashCode() : 0);
        result = 29 * result + (degree != null ? degree.hashCode() : 0);
        result = 29 * result + (vd != null ? vd.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append("id", id).append("sex", sex)
                .append("grade", grade).append("degree", degree).append("vd", vd).append("rawValue", rawValue)
                .append("tValue", tValue).toString();
    }

}
